<!doctype html>
<html>

<head>
    <meta charset="UTF-8">
    <title></title>
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
    <link href="../../libs/mui.min.css" rel="stylesheet"/>
    <link rel="stylesheet" type="text/css" href="../../libs/app.css"/>
    <link href="../../css/main.css" rel="stylesheet"/>
    <link href="../../css/assess-d.css" rel="stylesheet"/>
</head>

<body>
<div class="head">
    <img class="mui-action-back" src="../../images/all-left.png" alt="">
    <p>按揭垫资</p>
</div>
<div class="content">
    <!--列表-->
    <div class="list">
        <!--按揭垫资-->
        <div class="mui-table-view">
            <div class="mui-table-view-cell">
                <div class="lx-le">垫资需求</div>
                <div class="lx-ri"><input class="bd-ri price" placeholder="单行输入" value="" type="number"/><span
                        class="bd-m">万元</span></div>
            </div>
        </div>
        <!--还款期限-->
        <div class="mui-table-view">
            <div class="mui-table-view-cell">
                <div class="lx-le">还款期限</div>
                <div class="lx-ri"><input class="bd-ri day" placeholder="单行输入" value="" type="number"/><span
                        class="bd-m">天</span></div>
            </div>
        </div>
    </div>
    <!--按钮-->
    <div class="buttons">
        <!--<div class="add add-button">继续添加</div>-->
        <div class="add add-submit" id="evaluate">提交</div>
    </div>

</div>

<script src="../../libs/mui.min.js"></script>
<script src="../../js/jquery-3.1.1.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../js/url.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" src="../../js/assess-public.js"></script>
<script type="text/javascript">
  //  mui.plusReady(function () {
  //      var hold = plus.webview.currentWebview().hold;
  //      hold && $.closePages([hold]);
  //  });

    //判断是否从申请页过来
    localStorage.isAssess === 'aj' ? mui.toast('请您先进行该项评估！') : '';
    localStorage.isAssess = '';
    //		提交
    var params = new ToArr();
    $('#evaluate').on('tap', function () {
        //各参数数组
        var price = params.rechange('.price');
        var day = params.rechange('.day');
        //将各参数数组转换成符合格式的请求参数
        var arrObj = {price: price, day: day};
        var resParam = params.getParams(arrObj);

        var nian = /^[0-9]*$/;
        for (var i = 0; i < resParam.length; i++) {
            if ((!nian.test(price[i])) || price[i] == '' || price[i] == null) {
                mui.toast('请检查您填写信息...');
                return;
            } else if ((!nian.test(day[i])) || day[i] == '' || day[i] == null) {
                mui.toast('请检查您填写信息...');
                return;
            } else {
                if (i === resParam.length - 1) {
                    params.getAjax("aj", resParam);
                }
            }
        }
    });
    //add
    /*var addI = 1;
     var addList = "<div class=\"list\">\n  <!--按揭垫资-->\n\t<div class=\"mui-table-view\">\n\t\t<div class=\"mui-table-view-cell\">\n\t\t\t<div class=\"lx-le\">按揭垫资</div>\n\t\t\t<div class=\"lx-ri\"><span class=\"bd-m lx-ri\">元</span><input class=\"bd-ri price\" placeholder=\"单行输入\" value=\"\" type=\"number\" /></div>\n\t </div>\n\t</div>\n\t<!--还款期限-->\n\t<div class=\"mui-table-view\">\n\t\t<div class=\"mui-table-view-cell\">\n\t\t\t<div class=\"lx-le\">还款期限</div>\n\t\t\t<div class=\"lx-ri\"><span class=\"bd-m lx-ri\">天</span><input class=\"bd-ri day\" placeholder=\"单行输入\" value=\"\" type=\"number\" /></div>\n\t\t</div>\n\t</div>\n</div>";
     params.append(addList);*/
</script>
</body>

</html>